
get_script_path() {
	script_file=$BASH_SOURCE
	abs_script_file=$(readlink -f $script_file)
	abs_script_dir=$(dirname $abs_script_file)
}
get_script_path

# http://www.accellera.org/downloads/standards/systemc
mkdir tmp
cd tmp


if [ ! -e systemc-2.3.2.tar.gz ]; then
	# wget http://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.2.tar.gz
	cp $abs_script_dir/pkgs/systemc-2.3.2.tar.gz .
fi
tar -xvf systemc-2.3.2.tar.gz

set -e

cd systemc-2.3.2
mkdir build
cd build/
../configure --prefix=`pwd`/../../../sc
make -j4 && make install
cd `pwd`/../../../sc
ln -s lib64-linux64 lib
